mdSetTempo and mdSetDivision are irrelevant if the port is not in one of
the tick stamping modes (either MD_RELATIVETICK or MD_DELTATICK) and
should not be called.
mmmmddddGGGGeeeettttTTTTeeeemmmmppppoooo and mmmmddddGGGGeeeettttDDDDiiiivvvviiiissssiiiioooonnnn return the current tempo and division for
the port.
mmmmddddSSSSeeeettttTTTTeeeemmmmppppoooossssccccaaaalllleeee and mmmmddddGGGGeeeettttTTTTeeeemmmmppppoooossssccccaaaalllleeee set and return a tempo scale value
for the port. mdSetTempoScale changes the tempo of a port asychronously,
and is commonly used for real-time tempo adjustments. All tick mode
time stamps written to the port will be divided by this scale before
being queued for output, so that scale values greater than 1.0 will
result in a faster playback rate, while values less than 1.0 will result
is a slower playback rate.
mmmmddddTTTTiiiicccckkkkssssTTTTooooNNNNaaaannnnoooossss and mmmmddddNNNNaaaannnnoooossssTTTTooooTTTTiiiicccckkkkssss allow conversion between ticks and
nanoseconds using the current tempo on the port. These routines do not
take into account previous tempo or tempo scale changes. In order to
accurately convert a tick value to an absolute time (or vice-versa), an
application must maintain a list of all tempo changes in a MIDI stream.
RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
mdSetDivision and mdSetTempo return 0 on success and -1 on error.
mdGetDivision and mdGetTempo return the appropriate value or -1 on error.
The following error codes are expected:
ENXIO - Invalid port
EINVAL - An undefined operation was called.
BBBBUUUUGGGGSSSS
mdGetTempo returns the last tempo set, which is not necessarily the tempo
currently being used. In particular, if a MIDI tempo meta event is sent
to the port, mdGetTempo won't report the tempo change made by the meta